<?php
/* @var $this PictureController */
/* @var $model Picture */
/* @var $form CActiveForm */
?>

<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'picture-form',
	'enableAjaxValidation'=>false,
        'htmlOptions' => array('enctype'=>'multipart/form-data'),
)); ?>

	<p class="note">Fields with <span class="required">*</span> are required.</p>

	<?php echo $form->errorSummary($model); ?>

    <div class="row">
        <?php echo $form->labelEx($model,'url'); ?>
        <?php echo CHtml::activeFileField($model,'url');?>
        <?php echo $form->error($model,'url'); ?>
    </div>

    <div class='row'>
        <?php echo '图片预览' ?>
        <?php echo '<img src="'.Yii::app()->baseUrl.$model->url.' " style="width:200px;height:300px;"/>'; ?>
    </div>

	<div class="row">
		<?php echo $form->labelEx($model,'title'); ?>
		<?php echo $form->textField($model,'title',array('size'=>60,'maxlength'=>128)); ?>
		<?php echo $form->error($model,'title'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'type'); ?>
		<?php echo $form->textField($model,'type'); ?>
		<?php echo $form->error($model,'type'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'hit'); ?>
		<?php echo $form->textField($model,'hit'); ?>
		<?php echo $form->error($model,'hit'); ?>
	</div>

<!--	<div class="row">-->
<!--		--><?php //echo $form->labelEx($model,'createtime'); ?>
		<?php //echo $form->textField($model,'createtime'); ?>
<!--		--><?php //echo $form->error($model,'createtime'); ?>
<!--	</div>-->
    <div class="row">
        <?php echo $form->labelEx($model,'cand_id'); ?>
        <?php
        echo $form->dropDownList(
            $model,
            'cand_id',

            CHtml::listData(
                Candidate::model()->findAll(),
                'id',
                'title'
            )
        );
        //echo CHtml::activeDropDownList($model,'cand_id',CHtml::listData( Candidate::model()->findAll(), 'cand_id', 'title' ), array('prompt'=>'选择类别'));
        ?>
        <?php echo CHtml::error($model,'cand_id'); ?>
    </div>

	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->